package ru.pb.game.network.engine.client.packets.sendable;

import ru.pb.game.network.engine.client.packets.GameServerToClientPacket;
import ru.pb.game.objects.model.players.Player;

public class PROTOCOL_ROOM_CHANGE_PLAYER_NAME_ACK extends GameServerToClientPacket
{
	private Player _p;
	private int _color;

	public PROTOCOL_ROOM_CHANGE_PLAYER_NAME_ACK(Player p)
	{
		this(p, p.getNameColor(false));
	}

	public PROTOCOL_ROOM_CHANGE_PLAYER_NAME_ACK(Player p, int color)
	{
		_p = p;
		_color = color;
	}

	@Override
	public void writeImpl()
	{
		writeH(3590);
		writeD(_p.getSlot());
		writeS(_p.getName(), Player.NET_NICK_NAME_SIZE);
		writeC(_color);
	}
}